const Router = require('Koa-router')
const router = new Router({prefix: "/goods"})
const {upload,create,upade,allGoods} = require('../controller/Goods.controller')
const {auth, hadAdminPermission} = require("../middleware/auth.middleware");
const {validator}=require('../middleware/godds.middleware')
router.post('/upload',auth,hadAdminPermission,upload)
router.post('/',auth,hadAdminPermission,validator,create)
router.put("/:id",auth,hadAdminPermission,validator,upade)
router.get("/",auth,hadAdminPermission,allGoods)
module.exports = router